using FastNet.System.IServices;
using FastNet.System.Services;
using FastNet.WebApi.Extensions;

var builder = WebApplication.CreateBuilder(args);

#region config
AppSetting.Init(builder.Services, builder.Configuration);
#endregion

#region jwtbearer
builder.Services.AddAuthenticationExt();
#endregion

builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();

builder.Services.AddSwaggerGenExt();

builder.Services.AddScoped<IUserService, UserService>();

var app = builder.Build();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
    app.UseSwagger();
    app.UseSwaggerUI();
}

app.UseHttpsRedirection();

app.UseAuthentication();

app.UseAuthorization();

app.MapControllers();

app.Run();
